package AnimalDemo;

public class Test {
    public static  void func(Animal animal) {
        animal.eat();
    }
    public  static void testFly(IFly ifly) {
        ifly.fly();
    }
    public  static void testSwim(ISwim iSwim) {
       iSwim.swim();
    }
    public static void testRun(IRun iRun) {
        iRun.run();
    }
    public  static void testJump(IJump iJump) {
        iJump.jump();
    }
    public static void testSWJ(ISwimjump iSwimjump) {
        iSwimjump.SWJ();
    }

    public static void main(String[] args) {
        func(new Flog("青蛙"));
        func(new Duck("唐老鸭"));
    }
    public static void main1(String[] args) {
        testSwim(new Duck("唐老鸭"));
        testRun(new Dog("旺财"));
        testSWJ(new Flog("青蛙"));
    }
}
